/*
 * @Author: yanjikun
 * @Date: 2022-04-12 11:38:03
 * @LastEditors: yanjikun
 * @LastEditTime: 2022-04-12 11:40:25
 * @Description: file content
 */
import { provide, inject } from 'vue'
import { DynamicTableType } from '.'

const key = Symbol('dynamic-table')

export function createTableContext(instance: DynamicTableType) {
  provide(key, instance)
}

export function useTableContext() {
  return inject(key) as DynamicTableType
}
